package com.hejia.bulbul.service;

import java.util.Date;
import java.util.List;

import com.hejia.alauda.utils.Pager;
import com.hejia.bulbul.entity.PopularizeStatistic;

/**
 * 推广统计服务
 * @author hyr
 *
 */
public interface PopularizeStatisticService {

	/**
	 * 统计推广数据
	 * @param startDate	开始时间
	 * @param endDate	结束时间
	 * @param pager		分页
	 * @return			推广统计数据
	 */
	Pager<PopularizeStatistic> statisticPopularizes(Date startDate,
			Date endDate, Pager<PopularizeStatistic> pager);

	/**
	 * 按大类ID和时间统计推广
	 * @param biggerCategoryId	大类ID
	 * @param startDate			开始时间
	 * @param endDate			结束时间
	 * @return
	 */
	List<PopularizeStatistic> statisticPopularizeByBiggerCategoryIdAndDate(
			Long biggerCategoryId, Date startDate, Date endDate);

	/**
	 * 按类别ID和时间统计推广
	 * @param biggerCategoryId	大类ID
	 * @param categoryId		类别ID
	 * @param startDate			开始时间
	 * @param endDate			结束时间
	 * @return
	 */
	List<PopularizeStatistic> statisticPopularizeByCategoryIdAndDate(
			Long biggerCategoryId, Long categoryId, Date startDate, Date endDate);

	/**
	 * 根据大类查询推广统计
	 * @param pager
	 * @return
	 */
	Pager<PopularizeStatistic> findPopularizeStatisticByBiggerCategory(Pager<PopularizeStatistic> pager);

	/**
	 * 设置访问IP数
	 * @param statistics	统计列表
	 * @param startDate		开始日期
	 * @param endDate		结束日期
	 */
	void setVisitIPCount(List<PopularizeStatistic> statistics, Date startDate, Date endDate);

	/**
	 * 根据大类ID获取统计列表
	 * @param biggerCategoryId	大类ID
	 * @return
	 */
	List<PopularizeStatistic> getPopularizeStatisticByBiggerCategoryId(Long biggerCategoryId);

	/**
	 * 获取未停止推广统计
	 * @param biggerCategoryId	大类ID
	 * @param statistics		统计列表
	 * @return					未停止推广统计
	 */
	List<PopularizeStatistic> getNotStopPopularizeStatistics(Long biggerCategoryId, List<PopularizeStatistic> statistics);

	/**
	 * 统计访问IP数
	 * @param biggerCategoryId	大类ID
	 * @param startDate
	 * @param endDate
	 * @param statistics
	 */
	void countVisitIPByBiggerCategoryIdAndDate(Long biggerCategoryId, Date startDate, Date endDate, List<PopularizeStatistic> statistics);

	/**
	 * 统计类别ID获取统计列表
	 * @param biggerCategoryId
	 * @param categoryId
	 * @return
	 */
	List<PopularizeStatistic> getPopularizeStatisticByCategoryId(Long biggerCategoryId, Long categoryId);

	/**
	 * 统计访问IP数
	 * @param biggerCategoryId
	 * @param categoryId
	 * @param startDate
	 * @param endDate
	 * @param statistics
	 */
	void countVisitIPByCategoryIdAndDate(Long biggerCategoryId, Long categoryId, Date startDate, Date endDate, List<PopularizeStatistic> statistics);

	/**
	 * 获取未停止推广统计
	 * @param statistics	推广统计
	 * @return				未停止推广统计
	 */
	List<PopularizeStatistic> getNotStopPopularizeStatistics(Long biggerCategoryId, Long categoryId, List<PopularizeStatistic> statistics);

}
